package edu.gatech.spacetraderteam3.view;

/**
 * Represents an event
 * Holds information related to the event
 * @author Alexander Ikonomidis
 * @version 1.0
 */
public class SGGEvent {

    /**
     * The message given by the event
     */
    private final String message;

    /**
     * The source of the event
     */
    private final SGGComponent source;

    /**
     * Constructor. Sets event's message and the source of the event
     * @param message Event's message
     * @param source Source of the event
     */
    public SGGEvent(String message, SGGComponent source) {
        this.message = message;
        this.source = source;
    }

    /**
     * Getter for the event message
     * @return Event's Message
     */
    public String getMessage() {
        return message;
    }

    /**
     * Getter for the source of the event
     * @return Source
     */
    public SGGComponent getSource() {
        return source;
    }

    /**
     * Constructs string composed of source and the message
     * @return The String
     */
    public String toString() {
        return source + ": " + message;
    }
}
